package response

type Data any

type Response struct {
	Code    int
	Message string
	Success bool
	Data    Data
}

type Error struct {
	Code    int
	Message string
}

func (e Error) Error() string {
	return e.Message
}

const (
	OK                  = 0
	InvalidArgument     = 100
	BusinessError       = 200
	UnknownError        = 300
	AuthNeedLogin       = 401
	AuthTokenExpired    = 402
	AuthTokenParseError = 403
)

var Msg = map[int]string{
	OK:                  "OK",
	InvalidArgument:     "参数错误",
	BusinessError:       "业务出现错误",
	UnknownError:        "出现未知问题",
	AuthNeedLogin:       "请先登录",
	AuthTokenExpired:    "登录失效，请重新登录",
	AuthTokenParseError: "令牌非法",
}
